﻿@{
    Layout = null;
}

<div class="panel-body" style="padding:0">
    <div class="panel panel-default">
        <div class="panel-heading"></div>
        <div class="panel-body">
            <form id="formSearch" class="form-horizontal">
                <div class="form-group">
                    @if(string.IsNullOrEmpty(ViewBag.MerchantId))
                    {
                        <p style="color:red;font-size:20px;margin-left:30px;">该商户还未配置店铺信息，不允许操作产品分类，请您首先配置商户信息</p>
                    }
                </div>                   
                <div class="form-group">
                    <label class="control-label" for="name_search">产品分类</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="name_search" placeholder="请输入产品分类" />
                    </div>
                    <div class="col-sm-3">
                        <button type="button" id="btnQueryList" class="btn btn-primary"><i class="fa fa-search"></i>查询</button>
                        <button type="button" id="btnReset" class="btn btn-primary"><i class="fa fa-remove"></i>清空</button>
                    </div>
                </div>
            </form>
            <hr />
            <div>
                <table id="productcategoryinfo"></table>
            </div>
        </div>
    </div>
</div>

<div id="toolbar" class="btn-group">
    <button id="btnAddProductCategoryDialog" type="button" class="btn btn-primary"><span><i class="fa fa-edit"></i>&nbsp;添加</span></button>
    <button id="btnEditProductCategoryDialog" type="button" class="btn btn-primary"><span><i class="fa fa-book"></i>&nbsp;修改</span></button>
    <button id="btnDelProductCategoryDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;删除</span></button>
</div>

@*添加修改平台类别*@
<div class="modal fade" id="AddProductCategoryModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="HeadTitle">添加产品类别</h4>
            </div>
            <div class="modal-body">
                <form id="AddProductCategoryOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="Id" name="Id" />
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">店铺名称:</span>
                            <input type="text" value="@ViewBag.MerchantName" class="form-control" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">名称:</span>
                            <input type="text" id="Name" name="Name" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">排序:</span>
                            <input type="text" id="Sort" name="Sort" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">启用:</span>
                            <select class="form-control" id="Enable" name="Enable">
                                <option value="0">启用</option>
                                <option value="1">禁用</option>
                            </select>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnAddProductCategoryOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@*删除平台类别*@
<div class="modal fade" id="DelProductCategoryModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title">产品分类：(<span id="Delete_Head_Title">***</span>)删除确认页面</h4>
            </div>
            <div class="modal-body">
                <form id="DelProductCategoryOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="delete_id" name="delete_id" />
                    <div class="form-group">
                        <div class="input-group">
                            您确认要删除产品分类（<span id="Delete_Head_Title_OK">***</span>)吗？
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnDeleteProductCategoryOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

<script src="~/Scripts/project/min/productcategory.min.js"></script>
<script type="text/javascript">
    $(function () {
        ml.admin.productcategory.init({
            "MerchantId": "@ViewBag.MerchantId"
        });
    });
</script>